package cn.jiyun.service.impl;

import cn.jiyun.entity.Yddgl;
import cn.jiyun.mapper.YddglMapper;
import cn.jiyun.service.YddglService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class YddglServiceImpl extends ServiceImpl<YddglMapper, Yddgl> implements YddglService {

    @Autowired
    private YddglMapper yddglMapper;

    @Override
    public Page findPage(Integer pageNum, Integer pageSize, Yddgl yddgl) {
        Page<Yddgl> yddglPage = new Page<>(pageNum, pageSize);
        List<Yddgl> list = yddglMapper.findPage(yddglPage,yddgl);
        return yddglPage.setRecords(list);
    }

    @Override
    public Yddgl findById(Integer id) {
        return yddglMapper.findById(id);
    }
}
